package com.zhpan.indicator.drawer;

import com.zhpan.indicator.enums.IndicatorStyle;
import com.zhpan.indicator.options.IndicatorOptions;

/**
 * 形状创建工厂类
 *
 * @since 2021-04-13
 */
public class DrawerFactory {
    /**
     * 创建形状
     *
     * @param options 形状配置
     * @return 形状指示
     */
    public static IDrawer createDrawer(IndicatorOptions options) {
        switch (options.getIndicatorStyle()) {
            case IndicatorStyle.DASH:
                return new DashDrawer(options);
            case IndicatorStyle.ROUND_RECT:
                return new RoundRectDrawer(options);
            default:
                return new CircleDrawer(options);
        }
    }
}
